/*
* @Author: wanghongfucoder
* @Date:   2017-09-05 11:08:11
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-09-05 13:47:53
*/
public class Vertex implements Comparable <Vertex> {
	
	//节点名称
	private String name;

	/**
	 * 最短路劲长度
	 */
	private int path;

	//节点是否已经出列
	private boolean isMarked;

	public Vertex(String name){
		this.name=name;
		this.path=Integer.MAX_VALUE; //初始设置为无穷大
		this.setMarked(false);
	}

	public Vertex(String name,int path){
		this.name=name;
		this.path=path;
		this.setMarked(false);
	}

	public int compareTo(Vertex o){
		return o.path>path ? -1 : 1;
	}

	public int getPath(){
		return path;
	}

	public void setPath(int path){
		this.path=path;
	}

	public  void setMarked(boolean marked){
		this.isMarked=marked;
	}

	public  boolean isMarked(){
		return isMarked;
	}

	public String getName(){
		return name;
	}
}